\documentclass{article}
\usepackage{geometry}
\geometry{margin=1.5cm, vmargin={0pt,1cm}}
\setlength{\topmargin}{-1cm}
\setlength{\paperheight}{29.7cm}
\setlength{\textheight}{25.3cm}

% useful packages.
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{enumerate}
\usepackage{graphicx}
\usepackage{multicol}
\usepackage{fancyhdr}
\usepackage{layout}
%\usepackage{ctex}
\usepackage{listings}
\usepackage{subfigure}


% some common command
\newcommand{\dif}{\mathrm{d}}
\newcommand{\avg}[1]{\left\langle #1 \right\rangle}
\newcommand{\difFrac}[2]{\frac{\dif #1}{\dif #2}}
\newcommand{\pdfFrac}[2]{\frac{\partial #1}{\partial #2}}
\newcommand{\OFL}{\mathrm{OFL}}
\newcommand{\UFL}{\mathrm{UFL}}
\newcommand{\fl}{\mathrm{fl}}
\newcommand{\op}{\odot}
\newcommand{\Eabs}{E_{\mathrm{abs}}}
\newcommand{\Erel}{E_{\mathrm{rel}}}

\usepackage{xcolor}
\usepackage{fontspec} 
\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{comment}{rgb}{0.56,0.64,0.68}

\newfontfamily\monaco{Monaco}
\lstset {
aboveskip=3mm,
belowskip=3mm,
showstringspaces=false,       % underline spaces within strings
columns=flexible,
framerule=1pt,
rulecolor=\color{gray!35},
backgroundcolor=\color{gray!5},
basicstyle={\small\monaco},           % the size of the fonts that are used for the code
numbers=left,                   % where to put the line-numbers
numberstyle=\tiny\monaco\color{gray},  % the style that is used for the line-numbers
numbersep=5pt,                  % how far the line-numbers are from the code
commentstyle=\color{comment},
keywordstyle=\color{blue},
stringstyle=\color{dkgreen},
tabsize=2,                      % sets default tabsize to 2 spaces
captionpos=b,                   % sets the caption-position to bottom
breaklines=true,                % sets automatic line breaking
breakatwhitespace=false,        % sets if automatic breaks should only happen at whitespace
escapeinside={\%*}{*)},            % if add LaTeX within your code
morekeywords={*,...}               % if add more keywords to the set
}


\begin{document}
\title{Homework \#7}
\pagestyle{fancy}
\lhead{Name Li HuiTeng 3180102114}
\chead{ numAna\#7}
\rhead{Date 21.12.16}

% \section{8.15 Prove orders of accuracy for the above three FD formulas.}
% \begin{proof}[Proof]
% 	Expand $u(x+h),u(x-h)$ at x:
% 	\begin{align*}
% 		u(x+h) & =u(x)+hu'(x)+\frac{h^2}{2}u''(x)+\frac{h^3}{6}u'''(x)
% 		+\frac{h^4}{24}u^{(4)}(x)+O(h^5),                              \\
% 		u(x-h) & =u(x)-hu'(x)+\frac{h^2}{2}u''(x)-\frac{h^3}{6}u'''(x)
% 		+\frac{h^4}{24}u^{(4)}(x)+O(h^5).
% 	\end{align*}
% 	Thus,
% 	\begin{align*}
% 		E_1 & =D_+u(x)-u'(x)=u'(x)+\frac{h}{2}u''(x)+O(h^2)-u'(x)=\Theta (h),     \\
% 		E_2 & =D_-u(x)-u'(x)=u'(x)-\frac{h}{2}u''(x)+O(h^2)-u'(x)=\Theta (h),     \\
% 		E_3 & =D_0u(x)-u'(x)=u'(x)+\frac{h^2}{3}u'''(x)+O(h^4)-u'(x)=\Theta(h^2).
% 	\end{align*}
% \end{proof}

\section{7.13 Show the differences in the max-norm, 1-norm and 2-norm.}
\begin{proof}[Proof]
	When h inclines to 0,
	\begin{align*}
		\frac{||g||_{\infty}}{h} & =max|g_i/h|\leq max\{C_1,C_N\}\Rightarrow ||g||_{\infty}=O(h),                                                       \\
		||g||_1                  & =h\big((N-2)O(h^2)+2O(h)\big)=h\big((T/h-2)O(h^2)+O(h)\big)=h\big(O(h)\big)=O(h^2),                                  \\
		||g||_2                  & =\bigg(h\big((N-2)O(h^4)+2O(h^2)\big)\bigg)^{0.5}=\big(O(h^4)+2O(h^3))\big)^{0.5}=\big(O(h^3)\big)^{0.5}=O(h^{1.5}),
	\end{align*}
	where $C_1,C_N$ are from $g_1 \leq C_1h$, $g_N \leq C_Nh$, and $T=h\cdot N$ is a constant.
\end{proof}

\section{7.44 Show the first column of $B_E$ contains elements that are $O(1)$.}
\begin{proof}[Proof]
	Denote the first column of $B_E$ by $X$.
	Then $A_E X=e_1$, and we have
	\[
		\begin{pmatrix}-h&h&&&&&\\1&-2&1&&&&\\&1&-2&1&&&\\&&\ddots&\ddots&\ddots&&\\&&&1&-2&1&\\&&&&1&-2&1\\&&&&&0&h^2\end{pmatrix}\begin{pmatrix}x_{m+1}\\x_m\\\vdots\\\vdots\\x_2\\x_1\\x_0\end{pmatrix}=\begin{pmatrix}h^2\\0\\0\\\vdots\\0\\0\\0\end{pmatrix}
	\]
	Solve the equations, and 
	\[ 
	x_k=-kh,\quad k=0,1,\cdots,m+1.
	\]
	Since $(m+1)h=T=1$, every $|x_k|$ is bounded by 1. We conclude that X contains elements that are O(1).
\end{proof}

\section{7.39}
\begin{proof}
We have  
\begin{align*}
	u(x+h,y)+u(x-h,y)&=2[u(x,y)+\frac{h^2}{2}u_{xx}(x,y)+\frac{h^4}{24}u_{xxxx}(x)+\frac{h^6}{720}u_{xxxxxx}(x)]+O(h^8),\\
	D_{xx}u&=\frac{u(x+h,y)+u(x-h,y)-2u(x,y)}{h^2}=u_{xx}(x,y)+\frac{h^2}{12}u_{xxxx}(x,y)+O(h^4),
\end{align*}
Similarly, 
$$
D_{yy}u=\frac{u(x,y+h)+u(x,y-h)-2u(x,y)}{h^2}=u_{yy}(x,y)+\frac{h^2}{12}u_{yyyy}(x,y)+O(h^4).
$$
Thus 
\begin{align*}
	\tau_{i,j} &= (-D_{xx}-D_{yy})U_{ij}-(-\frac{\partial^2 }{\partial x^2}-\frac{\partial^2 }{\partial y^2})U_{ij}\\
	&=-\frac{h^2}{12}(\frac{\partial^4 }{\partial x^4}+\frac{\partial^4 }{\partial y^4})|_{(x_i,y_j)}+O(h^4).
\end{align*}
\end{proof}

\section{7.57}
\begin{proof}
For irregular interior point, we have
\begin{align*}
	U_A &= U_P + \theta h \frac{\partial }{\partial x}U_P + \frac{\theta^2h^2}{2}\frac{\partial^2 }{\partial x^2}U_P + \frac{\theta^3h^3}{6}\frac{\partial^3 }{\partial x^3}U_P + O(h^4)\\
	U_W &= U_P - h \frac{\partial }{\partial x}U_P + \frac{h^2}{2}\frac{\partial^2 }{\partial x^2}U_P - \frac{h^3}{6}\frac{\partial^3 }{\partial x^3}U_P + O(h^4)\\
	(L_hU_p)_1&=2\frac{(1+\theta)U_P-U_A-\theta U_W}{\theta(1+\theta)h^2}=-\frac{\partial^2 }{\partial x^2}U_P+\frac{h}{3}(1-\theta)\frac{\partial^3 }{\partial x^3}U_P + O(h^2).
\end{align*}
Similarly,
$$
(L_hU_p)_2=2\frac{(1+\alpha)U_P-U_B-\alpha U_S}{\alpha(1+\alpha)h^2}=-\frac{\partial^2 }{\partial y^2}U_P+\frac{h}{3}(1-\alpha )\frac{\partial^3 }{\partial y^3}U_P + O(h^2).
$$
Thus 
$$
\tau_{i,j} = \frac{h}{3}(1-\theta)\frac{\partial^3 }{\partial x^3}U_P + \frac{h}{3}(1-\alpha )\frac{\partial^3 }{\partial y^3}U_P +O(h^2)=O(h).
$$
For regular interior point, by 7.39 we know it's 2rd accurate.
\end{proof}
\section{7.59}
\begin{proof}
	Denote $K=\max\{\frac{T_1}{C_1},\frac{T_2}{C_2}\}$. Then for $P\in X_{\Omega_1}$,
	\begin{align*}
		L_h(\pm E_P+K\phi_P)\leq(\mp T_P-T_1)<0,
	\end{align*}
	and we have 
	\begin{align*}
		\max_{P\in X_{\Omega_1}}\pm E_P \leq \max_{P\in X_{\Omega_1}}(\pm E_P+K\phi_P)\leq \max_{Q\in X_{\partial\Omega_1}}(\pm E_Q+K\phi_Q) = K\max_{Q\in X_{\partial\Omega_1}}\phi_Q, 
	\end{align*}
	where the first step from $K\phi_P\geq0$, the second step from discrete maximum principle, and the third from $E_Q=0$ at each boundary point.
	
	Similarly, it's true for $P\in X_{\Omega_2}$. Combine such two inequalities and we prove the theorem.
\end{proof}
\end{document}

%%% Local Variables: 
%%% mode: latex
%%% TeX-master: t
%%% End: 
